<div id="leftcol">
    <div id="container-fluid">
        <?php
            $schs = $viewModel->get('sch');
            $cls = $viewModel->get("class");
        ?>
        <div class="form-inline">
            <div class="form-group">
                <label for="inputBeginDate">From: </label>
                <input type="text" class="iptDate" id="inputBeginDate" name="inputBeginDate" placeholder="dd/mm/yyyy">
                <label for="inputEndDate">To: </label>
                <input type="text" class="iptDate" id="inputEndDate" name="inputEndDate" placeholder="dd/mm/yyyy">
                <input type="button" class="btn btn-info" id="btnGetListSchedule" value="Get"/>
            </div>
           
        </div>
        <br>
        <form class="form-horizontal" method="POST">
            <div class="control-group">
                <label class="control-label" for="inputSubjectID">Class: </label>
                <div class="controls">
                    <select id="inputScheduleClassBySch" name="classes_id">
                        <option value="-1">Select Class</option>
                        <?php
                        foreach ($cls as $cl) {
                            echo "<option value='" . $cl->classes_id . "'>" . $cl->classname . "</option>";
                        }
                        ?>
                    </select>
                </div>
            </div>
        </form>
        <form>
    
            <div class="line"></div>
            <table class="table table-bordered table-hover table-condensed table-issue" id="tblSchedule">
                <thead>
                    <tr>
                        <th></th>
                        <th>Class</th>
                        <th>Date</th>
                        <th>Lession</th>
                        <th>Theory</th>
                        <th>Lab</th>
                    </tr>
                </thead>
                <tbody>
                    <?php //$schs cai nay chua lay
                    if ($schs == NULL) {
                        //echo "<pre>";
                        //var_dump ($schs);
                        //echo"</pre>";
                        //exit();
                        echo '<tr><td colspan="7">Empty</td</tr>';
                    } else {
                        ?>
                        <?php foreach ($schs as $sch) {?>
                            <tr>
                                <td><?php echo $sch->classname ?></td>
                                <td><?php
                                    $a = $sch->dates;
                                    $spl = explode("-", $a);
                                    echo "{$spl[2]}/{$spl[1]}/{$spl[0]}";
                                    ?></td>
                                <td><?php echo $sch->lession_name ?></td>
                                <td><?php echo $sch->theory ?></td>
                                <td><?php echo $sch->lab ?></td>
                                
                            </tr>
                        <?php } ?>
                    <?php } ?>
                </tbody>
            </table>
    
        </form>
    </div>
</div>